﻿<style>
	label{width:100px; float:left;}
	br{clear:left;}
	input ,select,textarea{margin:5px 0; width:400px;}
	textarea{height:200px;}
	h1{line-height:300%;}
	.kw_submit{width:100px; border-radius:5px; background-color:#393939; color:#fff; height:40px;}
</style>
<script type="text/javascript" src="source/plugin/smartpicker/template/jquery-3.2.1.min.js"></script>
<body>
<h1>{lang smartpicker:kw_welcome}</h1>

<form action="plugin.php?id=smartpicker:keywordset" method="POST" id="kw_form">
	<input type="hidden" name="kw_hidden">

	
	<label>{lang smartpicker:kw_name}:</label>
	<input type="text" name="kwname" placeholder="{lang smartpicker:must}" /><br>
	
	<label>{lang smartpicker:kw_short}:</label>
	<input type="text" name="kwshortname" placeholder="{lang smartpicker:must}" /><br>
	
	<label>{lang smartpicker:kw_level}:</label>
	<select name="kwlevel">
		<option value="1">1</option>
		<option value="2">2</option>
	</select><br>
	
	<label>{lang smartpicker:kw_father}；</label>
	<select name="kwfather">
		<option value="xxllx">{lang smartpicker:kw_xxllx}</option>
		<option value="xxllxfy">{lang smartpicker:kw_xxllxfy}</option>
		<option value="xxllxtj">{lang smartpicker:kw_xxllxtj}</option>
		<option value="xxllxys">{lang smartpicker:kw_xxllxys}</option>
		<option value="xxllxjy">{lang smartpicker:kw_xxllxjy}</option>
		<option value="xxllxw">{lang smartpicker:kw_xxllxw}</option>
		<option value="xxldx">{lang smartpicker:kw_xxldx}</option>
	</select><br>
	
	<label>{lang smartpicker:more};</label>
	<textarea type="text" name="kwmore" placeholder="{lang smartpicker:more}"></textarea><br>
	
	<input type="submit" name="submit" placeholder="{lang smartpicker:submit}" class="kw_submit" id="kw_submit">
</form>

<script type="text/javascript">
	$(document).ready(function(){
		var checkform = document.getElementById('kw_form');
		var checksubmit = document.getElementById('kw_submit');
		
		checksubmit.onclick = function(e){
			checksubmit.disabled = true;
			
			$.ajax({
				type: "POST",
				url: "plugin.php?id=smartpicker:keywordset",
				data:$(checkform).serialize(),
				error:function(request){
					alert("insert false");
					checksubmit.disabled = false;
				},
				success:function(ok){
					alert("insert success");
					checksubmit.disabled = true;
				}
			});
		}
		
	})
</script>


</body>